<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div>
  <a [routerLink]="['..']" class="gv-back-link"><small><< Back to credentials</small></a>
  <h1>WebAuthn credential</h1>
  <div class="audit-content" fxLayout="row">
    <form fxLayout="column" fxFlex="70">
      <div class="gv-form-section">
        <mat-form-field *ngIf="credential.credentialId" appearance="outline" floatLabel="always">
          <mat-label>Credential ID</mat-label>
          <input matInput placeholder="Timestamp" disabled [value]="credential.credentialId">
          <mat-hint>Credential ID</mat-hint>
        </mat-form-field>
        <mat-form-field *ngIf="credential.publicKey" appearance="outline" floatLabel="always">
          <mat-label>Public key</mat-label>
          <input matInput placeholder="Event Type" disabled [value]="credential.publicKey">
          <mat-hint>Credential public key</mat-hint>
        </mat-form-field>
        <mat-form-field *ngIf="credential.aaguid" appearance="outline" floatLabel="always">
          <mat-label>Authenticator Attestation Identifier</mat-label>
          <input matInput placeholder="Authenticator Attestation Identifier" disabled [value]="credential.aaguid">
          <mat-hint>Authenticator Attestation Identifier</mat-hint>
        </mat-form-field>
        <mat-form-field *ngIf="credential.attestationStatementFormat" appearance="outline" floatLabel="always">
          <mat-label>Attestation Statement Format</mat-label>
          <input matInput placeholder="Attestation Statement Format" disabled [value]="credential.attestationStatementFormat">
          <mat-hint>Attestation Statement Format</mat-hint>
        </mat-form-field>
        <mat-form-field *ngIf="credential.createdAt" appearance="outline" floatLabel="always">
          <mat-label>Created at</mat-label>
          <input matInput placeholder="Actor" disabled [value]="credential.createdAt | date: 'dd/MM/yyyy HH:mm:ss.sss'">
          <mat-hint>Credential creation time</mat-hint>
        </mat-form-field>
        <mat-form-field *ngIf="credential.accessedAt" appearance="outline" floatLabel="always">
          <mat-label>Accessed at</mat-label>
          <input matInput placeholder="Actor" disabled [value]="credential.accessedAt | date: 'dd/MM/yyyy HH:mm:ss.sss'">
          <mat-hint>Time of last access with this credential</mat-hint>
        </mat-form-field>
        <mat-form-field *ngIf="credential.ipAddress" appearance="outline" floatLabel="always">
          <mat-label>IP Address</mat-label>
          <input matInput placeholder="IP Address" disabled [value]="credential.ipAddress">
          <mat-hint>IP address of last access with this credential</mat-hint>
        </mat-form-field>
        <mat-form-field *ngIf="credential.userAgent" appearance="outline" floatLabel="always">
          <mat-label>User Agent</mat-label>
          <input matInput placeholder="User Agent" disabled [value]="credential.userAgent">
          <mat-hint>User agent of last access with this credential</mat-hint>
        </mat-form-field>
      </div>
    </form>
    <div class="gv-page-description" fxFlex>
      <h3>WebAuthn credential</h3>
      <div class="gv-page-description-content">
        <p>View the detailed properties of the WebAuthn credential.</p>
      </div>
    </div>
  </div>
</div>
